Skip to content

feat(web): collapse mobile composer by default#1263

Open
chirino wants to merge 1 commit intopingdotgg:mainfrom
chirino:chat-input-mobile
Open

feat(web): collapse mobile composer by default#1263
chirino wants to merge 1 commit intopingdotgg:mainfrom
chirino:chat-input-mobile

Conversation

@chirino
Copy link
Contributor

@chirino chirino commented Mar 21, 2026

Summary

On mobile viewports (< 640px), the chat composer now collapses to a compact single-row input when not focused, freeing up vertical space for reading the conversation. Tapping the collapsed bar expands the full composer with editor focus; blurring collapses it back.

Fixes #1262

Changes

  • Add mobile-collapsed state to the chat composer that hides the Lexical editor, toolbar controls, model picker, and attachment previews when unfocused
  • Show a compact row with truncated prompt text (or "Ask anything…" placeholder) and a send button in collapsed state
  • Desktop/wide-screen behavior is completely unchanged

Note

Collapse mobile composer by default in ChatView

  • On small viewports, the composer in ChatView.tsx collapses when unfocused, showing a single-line preview of the current prompt or pending answer alongside a circular send button.
  • Clicking the collapsed row expands the full composer and focuses the editor via requestAnimationFrame; blur collapses it again.
  • Status panels, image previews, and the bottom toolbar are all hidden while collapsed.
  • Behavioral Change: mobile users will see the compact composer by default until they tap to interact with it.

Macroscope summarized 5c33d5c.

@coderabbitai
Copy link

coderabbitai bot commented Mar 21, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 54f21e1e-e92b-4dbe-a802-28e577235e4e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can suggest fixes for GitHub Check annotations.

Configure the reviews.tools.github-checks setting to adjust the time to wait for GitHub Checks to complete.

@github-actions github-actions bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 21, 2026
@chirino chirino marked this pull request as ready for review March 21, 2026 00:45
Collapse the chat composer into a compact mobile preview until the user focuses or taps it, while preserving quick-send behavior for existing prompt content.

Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
@chirino chirino force-pushed the chat-input-mobile branch from b53d038 to 5c33d5c Compare March 21, 2026 01:01
: (prompt.trim() || "Ask anything...")}
</span>
<button
type="submit"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium components/ChatView.tsx:3649

The collapsed mobile send button (lines 3649-3659) allows submission when activePendingProgress exists but canAdvance is false. It only checks composerSendState.hasSendableContent, which doesn't validate whether the user has selected an option or provided a valid custom answer. This lets users submit incomplete responses that would be blocked in the expanded view (lines 3951-3979). Consider disabling the button when activePendingProgress exists and !activePendingProgress.canAdvance.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/components/ChatView.tsx around line 3649:

The collapsed mobile send button (lines 3649-3659) allows submission when `activePendingProgress` exists but `canAdvance` is false. It only checks `composerSendState.hasSendableContent`, which doesn't validate whether the user has selected an option or provided a valid custom answer. This lets users submit incomplete responses that would be blocked in the expanded view (lines 3951-3979). Consider disabling the button when `activePendingProgress` exists and `!activePendingProgress.canAdvance`.

Evidence trail:
apps/web/src/components/ChatView.tsx:3649-3659 (collapsed mobile button disabled condition), apps/web/src/components/ChatView.tsx:3967-3971 (expanded view button disabled condition), apps/web/src/pendingUserInput.ts:121 (canAdvance definition), apps/web/src/components/ChatView.tsx:2809-2819 (onAdvanceActivePendingUserInput function), apps/web/src/components/ChatView.tsx:2353-2355 (onSend calls onAdvanceActivePendingUserInput when activePendingProgress exists)

@Noojuno
Copy link
Contributor

Noojuno commented Mar 21, 2026

@chirino Can you please include before/after screenshots or video in your PR description?

@chirino
Copy link
Contributor Author

chirino commented Mar 21, 2026

IMG_3068 and IMG_3067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Collapse chat input box on mobile when not focused

2 participants